Copyright: Copyright ® Columbus Circle Investors 1995


 TVersionResource Component

Properties	Events

Unit

Version

Description

Returns information from the Microsoft Version Resource structure.  This is both a Design and Run Time component.  Whenever the FileName Property is changed, the VersionInfo Property is updated and an OnChange Event is triggered.  Likewise, when the Language or CharacterSet properties are changed, VersionInfo is updated and the OnChange Event is triggered.


TVersionResource Properties

Run-time Only	Key properties	Read Only

 CharacterSet

 FileName

 Language

 Name

 Tag

 VersionInfo


TVersionResource VersionInfo Property

Run-time Only	Key properties	Read Only

 Comment : string	 LegalCopyright : string

 CompanyName : string	 LegalTradeMarks : string

 FileDescription : string	 OriginalFileName : string

 FileOS : string	 PrivateBuild : string

 FileSubType : string	 ProductName : string

 FileType : string	 ProductVersion : string

 FileVersion : string	 Special Build : string

 InternalName : string


CharacterSet Property

Example

Applies To

TVersionResource Component

Declaration

property CharacterSet : TCharacterSet;

Description

Version Resources can contain multiple character sets.  The Character Set property allows you to select where to search for Version Resource strings.  Typically, the Character Set is Multilingual.

TCharacterSet is defined as follows:

Type

TCharacterSet = (csASCII, csJapan, csKorea, csTaiwan, csUnicode, csLatin2,

csCyrillic, csMultilingual, csGreek, csTurkish, csHebrew, csArabic);

When the CharacterSet changes, the VersionInfo Property is updated and an OnChange Event is triggered.


CharacterSet Example

The following example sets the Character Set to Multilingual.

VersionResource1.CharacterSet := csMultilingual;

To populate a list box with the strings representing the TCharacterSet enumerated type, add the following:

procedure TfrmMain.Loaded;

var S : string;

   LState : TLanguage;

   CSState : TCharacterSet;

begin;

   inherited loaded;

   for LState := low(TLanguage) to high(TLanguage) do begin

      S := copy(GetEnumName(TypeInfo(TLanguage, ord(LState))^, 3, 255);

      listBoxLanguage.items.add(S);

   end;

   for CSState := low(TCharacterSet) to high(TCharacterSet) do begin

      S := copy(GetEnumName(TypeInfo(TCharacterSet), ord(CSState))^, 3, 255);

      listBoxCharacterSet.items.add(S);

   end;

end;


FileName Property

Applies To

TVersionResource Component

Declaration

property FileName : String;

Description

The FileName Property determines where to search for Version Resource information.  When the filename changes, the component looks for new version information based on the current Character Set and Language and updates the VersionInfo Property.  An OnChange Event will be triggered after VersionInfo is updated.


Language Property

Example

Applies To

TVersionResource Component

Declaration

property Language : TLanguage;

Description

Version Resources can be written in multiple languages.  The Language Property allows you to select which language to view.  Typically, the language is US English.

TLanguage is defined as follows:

Type

TLanguage = (lnArabic, lnBulgarian, lnCatalan, lnTraditionalChinese, lnCzech,

lnDanish, lnGerman, lnGreek, lnUSEnglish, lnCastilianSpanish, lnFinnish,

lnFrench, lnHebrew, lnHungarian, lnIcelandic, lnItalian, lnJapanese, lnKorean,

lnDutch, lnNorwegianBokmal, lnPolish, lnBrazilianPortuguese, lnRhaetoRomanic,

lnRomanian, lnRussian, lnCroatoSerbian, lnSlovak, lnAlbanian, lnSwedish,

lnThai, lnTurkish, lnUrdu, lnBahasa, lnSimplifiedChinese, lnSwissGerman,

lnUKEnglish, lnMexicanSpanish, lnBelgianFrench, lnSwissItalian,

lnBelgianDutch, lnNorwegianNynorsk, lnPortuguese, lnSerboCroatian,

lnCanadianFrench, lnSwissFrench);

When the Language changes, the VersionInfo Property is updated and an OnChange Event is triggered.


Language Example

The following example sets the Language to US English.

VersionResource1.Language := lnUSEnglish;

See the CharacterSet Example for an example of putting the enumerated types into a list box.


TVersionResource Events

Run-time Only	Key properties	Read Only

OnChange


OnChange Event

Applies To

TVersionResource Component

Declaration

Property OnChange : TNotifyEvent;

Description

The OnChange event specifies which event to call when the contents of the VersionInfo Property are updated.